#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int a[100],b[100],c[100],m=0,n=0;
	int index = 0,input;
	while (scanf("%d", &input) != EOF)
	{
		a[index++] = input;
		char c = getchar();
		if (c == '\n')
			break;
	}
	int i,j;
	for (i=0; i < index; i++)
	{
		if (a[i] % 2 == 0)
		{
			b[m++] = a[i];
		}
		else
		{
			c[n++] = a[i];
		}
	}
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < n - i - 1; j++)
		{
			if (c[j] > c[j + 1])
			{
				int temp = c[j];
				c[j] = c[j + 1];
				c[j + 1] = temp;
			}
		}
	}
	for (i = 0; i < m; i++)
	{
		for (j = 0; j < m - i - 1; j++)
		{
			if (b[j] > b[j + 1])
			{
				int temp = b[j];
				b[j] = b[j + 1];
				b[j + 1] = temp;
			}
		}
	}
	for (i = n-1; i>=0; i--)
	{
		printf("%d ",c[i]);
	}
	for (i = 0; i < m; i++)
	{
		printf("%d ", b[i]);
	}
	return 0;
}